cmake_minimum_required(VERSION 2.6)
set(CMAKE_ALLOW_LOOSE_LOOP_CONSTRUCTS ON)

project(dx9)

# find library
set(Boost_USE_STATIC_LIBS ON)
find_package(Boost REQUIRED)
include_directories(${Boost_INCLUDE_DIRS})
link_directories(${Boost_LIBRARY_DIRS})

if (64BIT)
add_definitions(-D__64BIT__)
endif()

add_definitions(-D_WIN32_WINNT=0x0501)
add_definitions(-W3)

if (DEBUG)
add_definitions(-D__DEBUG__)
endif()

set(dx9_SOURCES
    D3D9Buffer.hpp
    D3D9Buffer.cc
	D3D9Render.hpp
	D3D9Render.cc
	D3D9RenderWindow.hpp
	D3D9RenderWindow.cc
	
	DX9.cc
	dx9.def
)

include_directories( 
	${PROJECT_SOURCE_DIR}
	"..\\..\\graphics"
	"C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Include"
)

if (64BIT)
link_directories(
	"C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Lib\\x64"
)
else()
link_directories(
	"C:\\Program Files (x86)\\Microsoft DirectX SDK (June 2010)\\Lib\\x86"
)
endif()

add_library(dx9 STATIC ${dx9_SOURCES})
target_link_libraries(dx9 graphics d3d9 d3dx9)